package com.yin.demo;


import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;

@Configuration
//@ConditionalOnClass(Servlet.class) // 当类路径下有 Servlet 类时才会实例化
//@ConditionalOnProperty(prefix = "hello", value = "enabled", havingValue = "true") // 当配置文件中 hello.enabled 为 true 时才会实例化
@ConditionalOnProperty(name = "hello.enabled", havingValue = "true") // 当配置文件中 hello.enabled 为 true 时才会实例化
@EnableConfigurationProperties(HelloProperties.class)
@ComponentScan(basePackages = "com.yin.demo")
public class HelloAutoConfiguration {
}
